<template>
  <div class="box">
    <div class="login">
      <div>
        用户名：
        <el-input placeholder="请输入姓名" v-model="username" clearable class="use"></el-input>
      </div>
      <div>
        密　码：
        <el-input placeholder="请输入密码" v-model="password" show-password class="use"></el-input>
      </div>
      <el-button type="primary" class="btn" @click="login" >登  录</el-button>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      username: "",
      password: "",
    };
  },

  mounted() {},

  methods: {
    login(){
      if(this.username==='admin' && this.password==='1111'){
        this.$router.push('/home')
      }
    }
  },
};
</script>

<style scoped>

.box {
  height: 100vh;
  width: 100vw;
  /* background-color: pink; */
  background-image: url("../../assets/bg.png") ;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
  overflow-x: hidden;
}
.login {
  padding: 50px;
  border: 1px solid blue;
  background-color: #fff;
  text-align: center;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(50%, -50%);
  opacity: 0.9;
}



.use {
  width: 200px;
  margin-bottom: 20px;
}

.btn{
  width: 120px;
  height: 40px;
  font-size: 18px;

}

</style>